import request from '@/utils/axios';

import { WebModuleVO } from './types';

export const listAllTreeApi = () => {
  return request.post<WebModuleVO[]>({ url: '/system/webModule/listAllTree' });
};

export const getApi = (id: string) => {
  return request.get<WebModuleVO>({ url: '/system/webModule/get/' + id });
};

export const getFullPathApi = (id: string) => {
  return request.get<string>({ url: '/system/webModule/getFullPath/' + id });
};

export const saveApi = (data: WebModuleVO) => {
  return request.post({ url: '/system/webModule/save', data });
};

export const updateApi = (data: WebModuleVO) => {
  return request.post({ url: '/system/webModule/update', data });
};

export const removeApi = (id?: string) => {
  return request.post({ url: '/system/webModule/remove', params: { id } });
};
